A few fixes to new I/O world.
} blkif_be_vbd_shrink_t;
/*
- * CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED:
+ * CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED:
* Notify the domain controller that the back-end driver is DOWN or UP.
* If the driver goes DOWN while interfaces are still UP, the domain
* will automatically send DOWN notifications.
*/
typedef struct {
unsigned int status; /* BLKIF_DRIVER_STATUS_??? */
-} blkif_be_driver_status_changed;
+} blkif_be_driver_status_changed_t;
#endif /* __DOMAIN_CONTROLLER_H__ */
# The DOM0 control interface is not set up via the management interface.
# Note that console messages don't come our way (actually, only driver
- # back-ends should use the DOM0 control interface). We therefore don't
- # need to set up console structures.
- xend.utils.port(0)
- xend.main.notifier.bind(port.local_port)
- xend.main.control_list[port.local_port] = (port, 0, 0, 0)
+ # back-ends should use the DOM0 control interface) -- the console
+ # structures are dummies.
+ dom0_port = xend.utils.port(0)
+ xend.main.notifier.bind(dom0_port.local_port)
+ xend.main.control_list[dom0_port.local_port] = \
+ (dom0_port, xend.utils.buffer(), xend.utils.buffer(), \
+ xend.console.interface(0, dom0_port.local_port))
##
## MAIN LOOP
void blkif_ctrlif_init(void)
{
+ ctrl_msg_t cmsg;
+ blkif_be_driver_status_changed_t st;
+
(void)ctrl_if_register_receiver(CMSG_BLKIF_BE, blkif_ctrlif_rx);
+
+ /* Send a driver-UP notification to the domain controller. */
+ cmsg.type = CMSG_BLKIF_BE;
+ cmsg.subtype = CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED;
+ cmsg.length = sizeof(blkif_be_driver_status_changed_t);
+ st.status = BLKIF_DRIVER_STATUS_UP;
+ memcpy(cmsg.msg, &st, sizeof(st));
+ ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
}
int __init xlblk_init(void)
{
+ ctrl_msg_t cmsg;
+ blkif_fe_driver_status_changed_t st;
+
(void)ctrl_if_register_receiver(CMSG_BLKIF_FE, blkif_ctrlif_rx);
+
+ /* Send a driver-UP notification to the domain controller. */
+ cmsg.type = CMSG_BLKIF_FE;
+ cmsg.subtype = CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED;
+ cmsg.length = sizeof(blkif_fe_driver_status_changed_t);
+ st.status = BLKIF_DRIVER_STATUS_UP;
+ memcpy(cmsg.msg, &st, sizeof(st));
+ ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
+
return 0;
}